Consider the region that lies under the curve
from
to
. Maple is a powerful graphing utility and we can get it to sketch this region by writing:
> plot(4*x-x^3,x=0..2,filled=true);
We may estimate that the area of this region is approximately 3 square units, since it is roughly the shape of a triangle with base 2 and height 3. Let's see how we might use mathematics to find the exact area of this region. Since ancient times people have been using polygonal shapes (such as triangles) to approximate areas such as these. A very tractable method involves using rectangles to approximate areas. To get Maple to help us visualize the rectangles we will use 10 rectangles, whose height is determined by using the right-hand endpoint of each of the 10 intervals, hence the command rightbox below.
> with(student):
> rightbox(4*x-x^3,x=0..2,10);
A reasonable approximation to the area of the region can be obtained by adding the areas of these 10 rectangles. Notice each of the rectangles has a base of 0.2 and a height which is given by the expression
evaluated at each of the 10 right-hand endpoints. So if we let
then we could write for our approximation
+ ... +
. We would like to point out two things here. First, this
sum follows a pattern which we can exploit enabling us to rewrite the sum using
sigma notation.
> Sum(0.2*f(0.2*i),i=1..10);
At this point, we haven't let Maple know what f is, so when we ask it to find the sum (by using a little s)
> sum(0.2*f(0.2*i),i=1..10);
we are back to what we had before translating to sigma notation. We know define f for Maple.
> f := x -> 4*x-x^3;
And now we can obtain the sum of the 10 rectangles.
> Sum(0.2*f(0.2*i),i=1..10);
> sum(0.2*f(0.2*i),i=1..10);
Secondly, there is a quicker way with Maple to get this sum by writing.
> rightsum(4*x-x^3,x=0..2,10);
> evalf(rightsum(4*x-x^3,x=0..2,10));
While this second way is nice, don't ignore the first since it helps you to develop a habit of mind that will be very useful in working homework problems and understanding the ideas behind this course.
Submission:
(a) Just as we have done above for the case of n = 10 rectangles, do the same with n = 20 and n = 30 rectangles. That is, use Maple's rightbox command to construct the rectangles that will approximate the area of the region, find the sum of the areas of the rectangles by observing a pattern and using the Sum command, and finally find the sum by using the rightsum command (which should serve as a check of your work with the Sum command).
(b) Use the Maple commands, leftbox and leftsum with n=30 on the above function.
(c) Repeat with middlebox and middlesum.
(d) Which do you think is most accurate, rightsum, middlesum or leftsum?
Submission worksheet: